<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>中小学生心理健康教育工作调查问卷</title>
		<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
		<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script> -->
		<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script> -->
		<!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
		<link rel="stylesheet" href="css/element.css">
		<script src="js/vue.js"></script>
		<script src="js/element-ui.js"></script>
		<script src="js/axios.min.js"></script>
		<script src="js/component.js"></script>
	</head>
	<style>
		.loginform {
			width: 17.5rem;
			/* width: 50rem; */
			background: #FFFFFF;
			box-shadow: 0px 0px 0.25rem 0px rgba(0, 0, 0, 0.2);
			padding: 5rem 10rem;
			margin: 0rem auto;
			border-radius: 0.125rem;
		}

		.formtitle {
			color: #1296FF;
			font-size: 1.5625rem;
			width: 100%;
			text-align: center;
		}

		.loginform p {
			text-align: center;
			font-size: 1.0625rem;
			font-weight: 550;
		}
	</style>
	<body>
		<div id="app">
			<div style="margin-top: 11rem;">
				<img style="width: 10rem;margin-left: 10rem;" src="./image/logo.png" />
			</div>
			<div class="loginform">
				<div class="formtitle">京师壹心心理云平台</div>
				<p>账号登陆</p>
				<el-input style="margin: 10px 0rem;" placeholder="请输入内容" prefix-icon="el-icon-user"
					v-model="form.account"></el-input>
				<el-input type="password" placeholder="请输入内容" prefix-icon="el-icon-lock" v-model="form.password">
				</el-input>
				<div align="center" style="margin-top: 30px;">
					<el-button style="width: 280px;border-radius: 10px;" type="primary" @click="submit_formFn">主要按钮
					</el-button>
				</div>
			</div>
		</div>
	</body>
	<script>
		new Vue({
			el: '#app',
			data: function() {
				return {
					form: {
						account: 'maidoudaxue',
						password: '123456'
					},
					input2: ''
				}
			},
			methods: {
				submit_formFn() {
					if (this.form.account === '' || this.form.password === '') {
						this.$message({
							message: '账号，密码不能为空！！！',
							type: 'warning'
						});
						return
					}
					axiosPost('/api/signUp', this.form).then(res => {
						const {
							msg,
							status,
							data
						} = res
						if (status === 1) {
							this.$message({
								message: msg,
								type: 'success'
							});
							location.href = 'content.html?token=' + data.token + '&user_name=' + data.user_name + '&school_info_title=' + data.school_info.title + '&province_title=' + data.school_info.province_title+ '&city_title=' + data.school_info.city_title+ '&area_title=' + data.school_info.area_title
							
						} else {
							this.$message.error(msg);
						}
					})
				}
			}
		})
	</script>
</html>
